package com.mongdbtokuduswagger.config;

import com.mongodb.MongoClientURI;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;

/**
 * @author Daft_V
 */
public abstract class AbstractMongoConfig {
    public MongoDbFactory mongoDbFactory(String uri) throws Exception {
        return new SimpleMongoDbFactory(new MongoClientURI(uri));
    }

    public abstract MongoTemplate getMongoTemplate() throws Exception;
}
